import 'package:json_annotation/json_annotation.dart';

part 'album_model.g.dart';

/// u76f8u518cu6a21u578b
@JsonSerializable()
class AlbumModel {
  final int? id;
  
  @JsonKey(name: 'album_name')
  final String albumName;
  
  @JsonKey(name: 'album_cover')
  final String? albumCover;
  
  final int? shared;
  
  @JsonKey(name: 'creator_id')
  final int? creatorId;
  
  @JsonKey(name: 'photo_size')
  final int? photoSize;
  
  @JsonKey(name: 'user_id')
  final int? userId;
  
  @JsonKey(name: 'create_at')
  final DateTime? createTime;
  
  @JsonKey(name: 'update_at')
  final DateTime? updateTime;

  AlbumModel({
    this.id,
    required this.albumName,
    this.albumCover,
    this.shared = 0,
    this.creatorId,
    this.photoSize = 0,
    this.userId,
    this.createTime,
    this.updateTime,
  });

  /// u4eceJSONu521bu5efau76f8u518cu6a21u578b
  factory AlbumModel.fromJson(Map<String, dynamic> json) => _$AlbumModelFromJson(json);

  /// u8f6cu6362u4e3aJSON
  Map<String, dynamic> toJson() => _$AlbumModelToJson(this);
}

/// u521bu5efau76f8u518cu8bf7u6c42u53c2u6570
@JsonSerializable()
class CreateAlbumParam {
  @JsonKey(name: 'album_name')
  final String albumName;
  
  @JsonKey(name: 'album_cover')
  final String? albumCover;
  
  final int? shared;
  
  @JsonKey(name: 'creator_id')
  final int? creatorId;
  
  @JsonKey(name: 'user_id')
  final int? userId;

  CreateAlbumParam({
    required this.albumName,
    this.albumCover,
    this.shared = 0,
    this.creatorId,
    this.userId,
  });

  /// u4eceJSONu521bu5efau53c2u6570u5bf9u8c61
  factory CreateAlbumParam.fromJson(Map<String, dynamic> json) => _$CreateAlbumParamFromJson(json);

  /// u8f6cu6362u4e3aJSON
  Map<String, dynamic> toJson() => _$CreateAlbumParamToJson(this);
}
